package xyz.yuelai.blog.entity;

public class UserRole {
	private Integer userID;
	private Integer roleID;
	
	@Override
	public boolean equals(Object obj) {
		if(this == obj) return true;
		if(obj == null || this.getClass() != obj.getClass()) return false;
		UserRole userRole  = (UserRole)obj;
		if(this.roleID != null ? !this.roleID.equals(userRole.roleID) : userRole.roleID != null)
			return false;
		if(this.userID != null ? !this.userID.equals(userRole.userID) : userRole.userID != null)
			return false;
		return true;
	}
	
	@Override
	public int hashCode() {
		int result = this.userID != null ? this.userID.hashCode() : 0;
        result = 31 * result + (this.roleID != null ? this.roleID.hashCode() : 0);
        return result;
	}

	public Integer getUserID() {
		return userID;
	}

	public void setUserID(Integer userID) {
		this.userID = userID;
	}

	public Integer getRoleID() {
		return roleID;
	}

	public void setRoleID(Integer roleID) {
		this.roleID = roleID;
	}
	
	public static void main(String[] args) {
		UserRole ur1 = new UserRole();
		UserRole ur2 = new UserRole();
		
		System.out.println(ur1.equals(ur2));
	}

}
